<!DOCTYPE html>
<head>
  <title>九九乘法表</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="7-1css.css">
</head>
<body>
  <?php
  echo '<table width="800" heigh="200" border="1">';
  for ($i = 1; $i <= 9; $i++) {
    echo '<tr>';
    for ($j = 1; $j <= 9; $j++) {
      if (($j * $i) % 3 == 0) {
        if ($j == $i) {
          echo '<td class="hov-bg bg">' . $j . '*' . $i . '=' . $i * $j . '</td>';
        } else {
          echo '<td class="hov-bg">' . $j . '*' . $i . '=' . $i * $j . '</td>';
        }
      } else {
        if ($j == $i) {
          echo '<td class="bg">' . $j . '*' . $i . '=' . $i * $j . '</td>';
        } else {
          echo '<td>' . $j . '*' . $i . '=' . $i * $j . '</td>';
        }
      }
    }
    echo '</tr>';
  }
  echo '</table>';

  class Emp {

    public $name = "";
    public $hobbies = "";
    public $birthdate = "";

  }

  $e = new Emp();
  $e->name = "sachin";
  $e->hobbies = "sports";
  $e->birthdate = date("2021/12/12");

  //echo json_encode($e);

  $arr = array('study' => ' ');
  //echo json_encode($arr); // 编码中文
  echo PHP_EOL;  // 换行符
  var_dump(json_encode(123));  // 不编码中文
# JSON 資料
  $json = '[{"name":"Mary","age":23},{"name":"John","age":19}]';

  # 將 JSON 格式資料轉換為 PHP 數組
  $obj = json_decode($json, true);
 echo $obj[0]["name"] . ":" . $obj[0]["age"];
 
  # 將 JSON 格式資料轉換為 PHP 對象
  $obj = json_decode($json);
   echo $obj[0]->name. ":" . $obj[0]->age;
echo strtr("I Love you",['I'=>'1','Lo'=>'L']);
$iipp=$_SERVER["REMOTE_ADDR"];
echo $iipp;
  ?>
</body>
</html>